package cn.com.czpb.client.module.actives.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import cn.com.czpb.client.R;
import cn.com.czpb.client.model.active.ActiveListBean;

import java.util.List;

/**
 * Created by 猪猪侠 on 2017/7/20.
 */

public class HuodongRecycleAdapter extends BaseQuickAdapter<ActiveListBean, BaseViewHolder> {
    private String type;
    private List<ActiveListBean> list;

    public HuodongRecycleAdapter(List<ActiveListBean> list, String type) {
        super(R.layout.recycle_huodong_main, list);
        this.type = type;
    }

    @Override
    protected void convert(BaseViewHolder helper, ActiveListBean item) {
        if (type.equals("0")) {
            Glide.with(mContext).load(item.getHeadpic()).crossFade().placeholder(R.drawable.default_bg).into((ImageView) helper.getView(R.id.img_bg_id));
        }
        helper.setText(R.id.title, item.getTitle())
                .addOnClickListener(R.id.rl_id);

    }


}
